package com.addressbook.tests;

//import static org.hamcrest.MatcherAssert.*;
//import static org.hamcrest.Matchers.*;

import java.io.File;

import org.testng.annotations.Test;

public class ExportTests extends TestBase {
	
	@Test
	public void shouldexportFile() throws Exception {
		final File file = File.createTempFile("export", ".csv");
		file.delete();
		Thread thread = new Thread() {
			@Override
			public void run() {
				super.run();
				app.getAutoItHelper()
					.winWaitAndActivate("Windows Internet Explorer", "", 5000)
					.click("Button3")
					.winWaitAndActivate("Save as", "", 5000)
					.focus("Edit1")
					.send("Edit1", file.getAbsolutePath())
					.click("Button1");
			}
		};
		thread.start();
		app.getNavigationHelper().clickExport();
		thread.join();
	}

}
